package org.rich.charlesmurphy.core.transformer;

import org.ddevil.data.Data;
import org.rich.charlesmurphy.core.CMIds;
import org.rich.charlesmurphy.model.Request;

/**
 * Transforms data that is imported from a Charle's CSV log.
 * @author Rich
 */
public class CharlesTransformer extends AbstractTransformer {

	@Override
	protected Request transformData(Data in) {
		Request r = new Request();
		r.copyDataFrom(in, CMIds.URL, CMIds.METHOD, CMIds.STATUS,
				CMIds.START_TIME, CMIds.ELAPSED_TIME, CMIds.REQUEST_HEADER_SIZE,
				CMIds.REQUEST_BODY_SIZE, CMIds.RESPONSE_HEADER_SIZE, CMIds.RESPONSE_BODY_SIZE);
		r.setRemoteHost("Charles");
		return r;
	}
}
